﻿package 
{
	import flash.display.MovieClip;
	import flash.events.Event;
	/**
	 * ...
	 * @author Jonghwa Kim
	 */
	public class MenuOutAnimation extends MovieClip
	{
		
		//private var gotoMenuToward:String;
		public function MenuOutAnimation() {
			
			//gotoMenuToward = _gotoMenuToward;
			
			addEventListener(Event.ADDED_TO_STAGE, Init);
			
		}
		
		private function Init(e:Event) {
			addEventListener(NavigationEvent.ANI_END, aniEndHandler);
			removeEventListener(Event.ADDED_TO_STAGE, Init);
		}
		
		private function aniEndHandler(e:NavigationEvent):void {
			//애니메이션이 끝나면 스스로 삭제하고 gotoMenuToward로 감
			trace(this, ": 애니메이션 끝 받음");
			
			removeEventListener(NavigationEvent.ANI_END, aniEndHandler);
			
			parent.dispatchEvent(new NavigationEvent(NavigationEvent.ANI_END, null, this));
			
			//parent(Clickr.as)에서 처리
			
			//parent.removeChild(this);
		}
		
		
		
		
		
		
	}
	
}